
Imports System.ComponentModel
Public Class dataTypes


    Public Enum dataType

        texto
        cadena
        entero
        enteroSingle
        enteroLargo

        decimalx

        doble

        fecha
        fechaLarga

        booleano
        blob
        varchar
        guid
        moneda
        imagen
        documento

        'adBigInt = 20
        'adBinary = 128
        'adBoolean = 11
        'adBSTR = 8
        'adChapter = 136
        'adChar = 129
        'adCurrency = 6
        'adDate = 7
        'adDBDate = 133
        'adDBFileTime = 137
        'adDBTime = 134
        'adDecimal = 14
        'adEmpty = 0
        'adError = 10
        'adFileTime = 64
        'adGUID = 72
        'adIDispatch = 9
        'adInteger = 3
        'adIUnknown = 13
        'adLongVarBinary = 205
        'adLongVarChar = 201
        'adLongVarWChar = 203
        'adNumeric = 131
        'adPropVariant = 138
        'adSingle = 4
        'adSmallInt = 2
        'adTinyInt = 16
        'adUnsignedBigInt = 21
        'adUnsignedInt = 19
        'adUnsignedSmallInt = 18
        'adUnsignedTinyInt = 17
        'adUserDefined = 132
        'adVarBinary = 204
        'adVarChar = 200
        'adVariant = 12
        'adVarNumeric = 139
        'adVarWChar = 202
        'adWChar = 130

    End Enum

    ' to put in the generated code the correct type
    Public Shared Function dataTypeInTemplate(ByVal tipo As dataType) As String
        Select Case tipo
            Case dataType.texto
                Return "string"
            Case dataType.cadena
                Return "string"

            Case dataType.entero
                Return "integer"
            Case dataType.enteroSingle
                Return "integer"
            Case dataType.enteroLargo
                Return "integer"

            Case dataType.decimalx
                Return "decimal"

            Case dataType.doble
                Return "double"

            Case dataType.fecha
                Return "date"
            Case dataType.fechaLarga
                Return "date"

            Case dataType.booleano
                Return "boolean"

            Case dataType.blob
                Return "string"
            Case dataType.varchar
                Return "string"
            Case dataType.guid
                Return "integer"
            Case dataType.moneda
                Return "double"

        End Select
    End Function

    ' to put in the generated code the correct type
    Public Shared Function dataTypeInTemplateCS(ByVal tipo As dataType) As String
        Select Case tipo
            Case dataType.texto
                Return "string"
            Case dataType.cadena
                Return "string"

            Case dataType.entero
                Return "int"
            Case dataType.enteroSingle
                Return "int"
            Case dataType.enteroLargo
                Return "long"

            Case dataType.decimalx
                Return "float"

            Case dataType.doble
                Return "double"

            Case dataType.fecha
                Return "date"
            Case dataType.fechaLarga
                Return "date"

            Case dataType.booleano
                Return "bool"

            Case dataType.blob
                Return "string"
            Case dataType.varchar
                Return "string"
            Case dataType.guid
                Return "integer"
            Case dataType.moneda
                Return "double"

        End Select
    End Function

    ' to put in the generated code the correct type
    Public Shared Function dataTypeInTemplateInC(ByVal tipo As dataType) As String
        Select Case tipo
            Case dataType.texto
                Return "string"
            Case dataType.cadena
                Return "string"

            Case dataType.entero
                Return "Int32"
            Case dataType.enteroSingle
                Return "Int32"
            Case dataType.enteroLargo
                Return "Int64"

            Case dataType.decimalx
                Return "decimal"

            Case dataType.doble
                Return "double"

            Case dataType.fecha
                Return "date"
            Case dataType.fechaLarga
                Return "date"

            Case dataType.booleano
                Return "bool"

            Case dataType.blob
                Return "string"
            Case dataType.varchar
                Return "string"
            Case dataType.guid
                Return "integer"
            Case dataType.moneda
                Return "double"
            Case Else
                Return "string"
        End Select
    End Function
End Class


